/*
 * tuongky.c
 *
 *  Created on: Mar 27, 2013
 *      Author: locpm
 */

#include <stdio.h>
#include "protos.h"
#include "data.h"
#include "globals.h"

int main(int argc, char *argv[])
{
	debugMode = TRUE;
	initData();

	if (debugMode)
	{
		printf("white rooks:\n");
		displayBitBoard(board.whiteRooks);
		printf("\n");

		printf("black rooks:\n");
		displayBitBoard(board.blackRooks);
		printf("\n");

		printf("number of black rooks: %u\n", bitCntBB(board.blackRooks));
		printf("\n");

		printf("bitCnt(538968064): %u\n", bitCnt(538968064));
		printf("\n");

		printf("white horses:\n");
		displayBitBoard(board.whiteHorses);
		printf("\n");

		printf("black horses:\n");
		displayBitBoard(board.blackHorses);
		printf("\n");

		printf("white pieces:\n");
		displayBitBoard(board.whitePieces);
		printf("\n");

		printf("black pieces:\n");
		displayBitBoard(board.blackPieces);
		printf("\n");

		printf("occupied squares:\n");
		displayBitBoard(board.occupiedSquares);
		printf("\n");

		printf("ELEPHANT_ATTACKS[C0][0]:\n");
		displayBitBoard(ELEPHANT_ATTACKS[C0][0]);
		printf("\n");

		printf("BITBOARDSET[A0]:\n");
		displayBitBoard(BITBOARDSET[A0]);
		printf("\n");

		printf("ATTACKS_RIGHT[A0]:\n");
		displayBitBoard(ATTACKS_RIGHT[A0]);
		printf("\n");

		printf("ATTACKS_RIGHT[B1]:\n");
		displayBitBoard(ATTACKS_RIGHT[B1]);
		printf("\n");

		printf("ATTACKS_RIGHT[C2]:\n");
		displayBitBoard(ATTACKS_RIGHT[C2]);
		printf("\n");

		printf("ATTACKS_TOP[A0]:\n");
		displayBitBoard(ATTACKS_TOP[A0]);
		printf("\n");

		printf("ATTACKS_TOP[B1]:\n");
		displayBitBoard(ATTACKS_TOP[B1]);
		printf("\n");

		printf("ATTACKS_TOP[C2]:\n");
		displayBitBoard(ATTACKS_TOP[C2]);
		printf("\n");

		printf("findLastOne(9): %u\n", findLastOne(9));
		printf("\n");

		printf("findLastOne(17): %u\n", findLastOne(17));
		printf("\n");

		printf("ATTACKS_LEFT[A0]:\n");
		displayBitBoard(ATTACKS_LEFT[A0]);
		printf("\n");

		printf("ATTACKS_LEFT[B1]:\n");
		displayBitBoard(ATTACKS_LEFT[B1]);
		printf("\n");

		printf("ATTACKS_LEFT[C2]:\n");
		displayBitBoard(ATTACKS_LEFT[C2]);
		printf("\n");

		printf("ATTACKS_BOTTOM[A0]:\n");
		displayBitBoard(ATTACKS_BOTTOM[A0]);
		printf("\n");

		printf("ATTACKS_BOTTOM[B1]:\n");
		displayBitBoard(ATTACKS_BOTTOM[B1]);
		printf("\n");

		printf("ATTACKS_BOTTOM[I9]:\n");
		displayBitBoard(ATTACKS_BOTTOM[I9]);
		printf("\n");

		printf("ATTACKS_BOTTOM[H8]:\n");
		displayBitBoard(ATTACKS_BOTTOM[H8]);
		printf("\n");

		printf("ATTACKS_LEFT[I9]:\n");
		displayBitBoard(ATTACKS_LEFT[I9]);
		printf("\n");

		printf("HORSE_OBSTRUCTS[B9][0]:\n");
		displayBitBoard(HORSE_OBSTRUCTS[B9][0]);
		printf("\n");

		printf("HORSE_OBSTRUCTS[B9][1]:\n");
		displayBitBoard(HORSE_OBSTRUCTS[B9][1]);
		printf("\n");

		printf("HORSE_OBSTRUCTS[B9][2]:\n");
		displayBitBoard(HORSE_OBSTRUCTS[B9][2]);
		printf("\n");

		printf("HORSE_OBSTRUCTS[B9][3]:\n");
		displayBitBoard(HORSE_OBSTRUCTS[B9][3]);
		printf("\n");
	}

    readCommands();
    return 0;
}
